Skip to content

Chore: Improve array contains test coverage #2030

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

kazantsev-maksim
Copy link
Contributor

Which issue does this PR close?

Part of: #1902

Rationale for this change

Part of: #1902

What changes are included in this PR?

  1. Add more test for array_contains function
  2. Delete IncompatExpr

How are these changes tested?

Add more unit tests

@@ -218,7 +218,7 @@ class CometArrayExpressionSuite extends CometTestBase with AdaptiveSparkPlanHelp
}
}

test("array_contains") {
test("array_contains - int values") {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would comment that INTs are in separate tests as ints require incompatible flag

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops, I forgot to disable this setting.

checkSparkAnswerAndOperator(
sql(s"SELECT array_contains(cast(null as array<$typeName>), b) FROM t2"))
checkSparkAnswerAndOperator(sql(
s"SELECT array_contains(cast(array() as array<$typeName>), cast(null as $typeName)) FROM t2"))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

array literals might wait for #1977

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The literals are now in a dedicated test marked for exclusion ("ignored")

@comphead
Copy link
Contributor

related to #1929

@codecov-commenter
Copy link

codecov-commenter commented Jul 19, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 58.66%. Comparing base (f09f8af) to head (b441228).
Report is 330 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff              @@
##               main    #2030      +/-   ##
============================================
+ Coverage     56.12%   58.66%   +2.54%     
- Complexity      976     1252     +276     
============================================
  Files           119      134      +15     
  Lines         11743    13111    +1368     
  Branches       2251     2401     +150     
============================================
+ Hits           6591     7692    +1101     
- Misses         4012     4179     +167     
- Partials       1140     1240     +100     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Kazantsev Maksim added 3 commits July 19, 2025 22:27
@@ -136,7 +136,7 @@ object CometArrayAppend extends CometExpressionSerde with IncompatExpr {
}
}

object CometArrayContains extends CometExpressionSerde with IncompatExpr {
object CometArrayContains extends CometExpressionSerde {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cc @andygrove as Andy introduced IncompatExpr trait here

Copy link
Contributor

@comphead comphead left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks @kazantsev-maksim I think it is LGTM just waiting for @andygrove to confirm the IncompatExpr trait can be safely removed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants